package com.web44.spring.config;

import com.web44.spring.bean.Student;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * @Title: SpringConfig
 * @Description:
 * @Auther: py
 * @Version: 1.0
 * @create 2024/1/9 13:34
 */
// @Configuration 相当于xml配置文件
@Configuration  // bean.xml
@ComponentScan("com.web44.spring")  //  <context:component-scan base-package="com.web44.spring"></context:component-scan>
public class SpringConfig {

    /*
    * <bean id="student" class="com.web44.spring.bean.Student">
    * */
    @Bean("s")
    public Student student() {
        return new Student();
    }
}
